#include<bits/stdc++.h>
using namespace std;
int h[100001],a[100001],tank[100001],cnt=0,hx[100001];
int ans=0;
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    int n;
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
        if(h[a[i]]==0)
        {
            tank[++cnt]=a[i];
        }
        h[a[i]]++;
        hx[a[i]]++;
    }
    sort(tank+1,tank+1+cnt);
    //for(int i=1;i<=cnt;i++)cout<<tank[i]<<" ";
    int l=1,r=2;
    while(r<=cnt)
    {
        int x=h[tank[l]],y=hx[tank[r]];
        //cout<<x<<" "<<y<<"\n";
        if(y>x)
        {
            h[tank[l]]=0;
            ans+=x;
            hx[tank[r]]-=x;
            l++;
            if(l==r)r++;
        }
        if(y==x)
        {
            h[tank[l]]=0;
            hx[tank[r]]=0;
            ans+=x;
            l++,r++;
        }
        if(y<x)
        {
            hx[tank[r]]=0;
            h[tank[l]]-=y;
            ans+=y;
            r++;
        }
        //cout<<x<<" "<<y<<"\n";
    }
    cout<<n-ans;
}














